import {defineStore} from 'pinia'
import {ref, computed} from "vue";

export const useOptionStore = defineStore('optionStore', {
    state: () => ({
        // 总数
        count: 0,
        // 是否手机
        isMobile:false,
    }),
    getters: {
        double: (state) => state.count * 2,
    },
    actions: {
        async increment() {
            this.count++
        },
    },
})

export const useSetupStore = defineStore("setupStore", () => {
    const count = ref(0)
    const countAdd = computed(() => {
        return count.value + 5
    })
    const increment = async () => {
        count.value++
    }

    return {count, countAdd, increment}
})
